import React, { Component, ComponentClass } from 'react';
import Taro from '@tarojs/taro';
import Skeleton from 'taro-skeleton'
import {AtIcon, AtTabs, AtFloatLayout, AtModal, AtModalHeader, AtModalAction} from 'taro-ui';
import {connect} from 'react-redux';
import {Image, Block, View, Text, ScrollView, Button} from '@tarojs/components';
import {DateType} from '../../reducers/select-date';
import {platform} from '../../utils/platform-settting.service';
import {
  SiteInfo,
  Good,
  PlatformSet, SubscriptionType
} from '../../utils/server.interface';
import {http} from '../../utils/http';
import JoinTt from '../components/join-tt/join-tt'
import {
  TOURIST_INFO,
  TOURIST_DETAIL,
  TOURIST_DETAIL_SITE,
  LIMIT_FROM_SELLER_SINCE,
  USER_SALE_SUB,
  OFF_USER_SALE_SUB,
  TARO_ENV,
  RESOURCE_URL,
  ROOKIEGUID_TASK_RECORD,
  GOODS_EVALUATION_APP_LIST,
  CONTENT_QR,
  CONTENT_QRWX,
  ADD_SHARE_VOLUME,
  GET_PRODUCT_LABELS,
  BUBBLE_GET_INFO,
  UPDATE_USER_SHARE_DATE, SHARE_SHARE_INFO, SHARE_USER_SHARE_INFO, SCAN_BIND_SELLER,
  IDENTITY_IS_SELLER, IDENTITY
} from '../../constants/api';
import fetchNewGoodsList from "../../utils/fetchNewGoodsList";
import {getSharePoster, getPoster} from '../../utils/poster.service'
import {user} from '../../utils/user.service';
import ProductName from '../components/product-name/product-name';
import EnterStore from '../components/enter-store/enter-store';
import OtherBar from '../components/detail-bar/other-bar';
import DetailHeader from '../components/detail-header/detail-header';
import {location} from '../../utils/location.service';
import {
  getHeadTop,
  GetRequest,
  getTempSellerId, isPc,
  lastMinute,
  setTempSellerId,
  vcmonitor,
  dealRefundSign
} from '../../utils/tools';
import MakePoster from '../components/make-poster/make-poster';
import SupportBar from '../../components/support-bar/support-bar'
import LiveBar from "../components/live-bar/live-bar";
import JoinWx from "../components/join-wx/join-wx";
import Subscription from "../../components/subscription";
import {newHttp} from "../../utils/request";
import {h5Wx} from "../../utils/h5.service";
import CouponBox from "../components/coupon-box";
import GzhAuth from "../../components/gzh-auth/gzh-auth"
import Evaluation from "../components/evaluation/evaluation";
import Headercar from "../components/header-car/header-car";
import PopView from '../pop/popView'
import statistics from "../statistics/statistics";
import Category from "../../pages/index/template/regionalCategory/component/category";
import {lxH5Wx} from "../../utils/lx.h5.service";
import {getBdInfo, getMemberAdvertisement} from "../../utils/getCommonData";
import AdvertisementMember from "../../components/advertisement/member";
import {
  getContent,
  getGoodsInstructions,
  getLongUrl, getShareSpuId,
  handlerCollection,
  handlerRichImage
} from "../../utils/handlerPublicCode";
import '../scenic/detail.scss';
import './detail.scss';
import JoinTtGroup from "../components/join-tt-group/join-tt-group";

const status: { [key: string]: number } = {selling: 1, beginning: 0, ending: 99, sellout: -1};
type PageStateProps = {
  selectDate: DateType
}

type PageDispatchProps = {}

type PageOwnProps = {}

type PageState = {
  is_favorite: number
  goodStatus: number
  isShowShareButton: boolean
  isUser: boolean
  power: boolean
  bdInfo?: any
  overFlag: boolean
  limitGoodsId: any
  force_platform_seller: any
  memberAdvertisement: any
  goodsDiscountCodeType: any
  pkeys: any
  goodsDiscountCodeId: any
  sloganList: any
  userPower: any
  isOpenedNotice: any
  popInfo: any
  shareSetting: any
  fromOrderNum: string
  itemId: string
  itemName: string
  sharePoster: false | { url: string }
  good: any
  info: any
  siteInfo: SiteInfo | false
  tabIndex: number
  tabs: { title: string; name: 'meal' | 'notice' | 'desp' | 'appointment' | 'recommend' | 'evaluation' | 'itinerary_details' | 'expense_description' }[]
  recommendGood: Good[]
  evaluationList: []
  labels: []
  recordsTotal: any
  sitePhone: string
  siteServiceWx: string
  floatLayout: boolean
  isOpened: boolean
  notice: string
  destination: string[]
  departure: string[]
  bindSellerId: number
  searchBarTop: number
  minHeight: any
  isHideNavigation: number
  height: number
  showLoading: boolean
  platformSet?: PlatformSet
  openMp: SubscriptionType | false
  description: string
  expense_description: string
  itinerary_details: string
  allNotice: string
  isLogin: boolean
  tempSellerId: string
  modalShow: boolean
  qrImg: any
  qrImgDescribe: any
  wxModalShow: boolean
  wxQrImg: any
  currentIndex: number
  currentFlag: boolean
  refundLabels: any
}

type IProps = PageStateProps & PageDispatchProps & PageOwnProps

interface DetailWeb {
  props: IProps
}

@connect(({selectDate}) => ({
  selectDate,
}), () => ({}))

class DetailWeb extends Component {
  state: PageState = {
    is_favorite: 0,
    goodStatus: 1,
    isShowShareButton: true,
    isUser: true,
    bdInfo: false,
    overFlag: false,
    limitGoodsId: '',
    memberAdvertisement: '',
    force_platform_seller: '',
    goodsDiscountCodeType: '',
    pkeys: '',
    goodsDiscountCodeId: '',
    isOpenedNotice: false,
    popInfo: false,
    power: false,
    sloganList: [],
    userPower: '',
    shareSetting: [],
    fromOrderNum: '',
    itemId: '',
    itemName: '',
    sharePoster: false,
    height: 550,
    good: false,
    info: {
      goodsList: [],
      isSeller: 0,
      is_sale: 1,
    },
    siteInfo: false,
    tabIndex: 0,
    tabs: [],
    recommendGood: [],
    evaluationList: [],
    labels: [],
    recordsTotal: 0,
    sitePhone: '',
    siteServiceWx: '',
    floatLayout: false,
    isOpened: false,
    notice: '',
    destination: [],
    departure: [],
    isHideNavigation: 0,
    minHeight: 0,
    bindSellerId: 0,
    searchBarTop: 0,
    showLoading: true,
    openMp: false,
    allNotice: '',
    description: '',
    expense_description: '',
    itinerary_details: '',
    isLogin: false,
    tempSellerId: '',
    modalShow: false,
    qrImg: '',
    qrImgDescribe: '',
    wxModalShow: false,
    wxQrImg: '',
    currentIndex: 0,
    currentFlag: false,
    refundLabels: []
  }

  async UNSAFE_componentWillMount() {
    vcmonitor(this)
    const isH5 = TARO_ENV === 'h5'
    const platformSet = await platform.getSetting()
    Taro.getSystemInfo({
      success: (res) => {
        this.setState({minHeight: res.windowHeight / 2 - 60})
      }
    })
    let id = '';
    let isId = false;
    const {
      scene = '',
      orderNum = '',
      mpkey = '',
      itemId = '',
      force_platform_seller = '',
      goodsId = '',
      goodsDiscountCodeType = '',
      goodsDiscountCodeId = '',
      pkeys = ''
    } = Taro.getCurrentInstance().router.params
    const limitGoodsId = goodsId
    const headTop: any = getHeadTop()
    const fromOrderNum = orderNum
    const searchBarTop = process.env.TARO_ENV === 'tt' ? 0 : headTop.statusBar > 20 ? (headTop.statusBar + headTop.top + 40) : (headTop.statusBar + headTop.top + 50)
    this.setState({
      bdInfo: await getBdInfo(),
      fromOrderNum,
      searchBarTop,
      pkeys,
      force_platform_seller,
      limitGoodsId,
      goodsDiscountCodeType,
      goodsDiscountCodeId
    })
    let bindSellerId = Taro.getStorageSync('bindSellerId') || 0;
    if (scene && (/^\d+_\d+_\d+$/.test(scene) || /^\d+_\d+_\d+_\d+$/.test(scene))) {
      platform.scene = 0;
      const paramArr = scene.split('_');
      if (!paramArr[0] || !paramArr[1] || !paramArr[2]) {
        Taro.showToast({
          title: '无效的参数',
          icon: 'none'
        });
        Taro.switchTab({url: '/pages/index/index'})
        return false;
      }
      if (paramArr[3]) {
        const tempSellerId = paramArr[3]
        setTempSellerId(tempSellerId)
        this.setState({tempSellerId})
      }
      id = paramArr[0];
      if (platformSet.isSellerPermanentLock) {
        if (!bindSellerId) {
          bindSellerId = paramArr[2];
        }
      } else {
        bindSellerId = paramArr[2];
      }
      isId = true;
    } else {
      const tempSellerId = getTempSellerId(this)
      this.setState({tempSellerId: tempSellerId})
      if (platformSet.isSellerPermanentLock) {
        if (!bindSellerId) {
          bindSellerId = Taro.getCurrentInstance().router.params.bindSellerId || bindSellerId;
        }
      } else {
        bindSellerId = Taro.getCurrentInstance().router.params.bindSellerId || bindSellerId;
      }
      if (!Taro.getCurrentInstance().router.params || !itemId) {
        Taro.showToast({
          title: '无效的参数',
          icon: 'none'
        });
        Taro.navigateBack();
        return false;
      }
      id = itemId
    }
    user.bindSellerId = bindSellerId
    Taro.setStorage({
      key: 'bindSellerId',
      data: user.bindSellerId
    })
    const detail = await this.getDetailData(id, bindSellerId, isId);
    if (!detail) return false
    if (isH5 && process.env.NODE_ENV !== 'development') {
      await user.mpKeyCheckLogin(mpkey, 3, detail.uuid || '')
    }
    if (isH5 && goodsDiscountCodeType) {
      statistics()
    }
    if (detail.images && detail.images.length > 0) {
      try {
        await Taro.getImageInfo({
          src: detail.images[0].url + "?x-oss-process=image/resize,w_750",
          success: (res) => {
            const b = 750 / res.width
            this.setState({height: res.height * b})
          }
        })
      } catch (e) {
      }
    }
    if (!isH5 && bindSellerId) {
      Taro.login({
        success: (res) => {
          if (res.code) {
            const integralForm = {
              sellerId: bindSellerId,
              code: res.code,
              name: detail.name
            }
            http.post(LIMIT_FROM_SELLER_SINCE, integralForm);
          }
        }
      })
    }
    await this.initData(detail)
    this.onlyData(detail, platformSet)
    this.setState({
      bindSellerId
    })
  }

  shareParams = ''
  navigationBarTitle = ''

  async componentDidShow() {
    const platformSet = platform.info
    this.navigationBarTitle = process.env.P_ENV === 'lx' ? '商品详情' : platformSet.platformName
    await Taro.setNavigationBarTitle({
      title: this.navigationBarTitle
    })
    if (TARO_ENV === 'h5') {
      await h5Wx.getConfig()
    }
    clearInterval(this.clearTimeOutGetInfoId)
    const isLogin = await user.checkLogin();
    this.setState({isOpened: false, isLogin})
    let id = ''
    let tempSellerIdParams = ''
    let bindSellerId = Taro.getStorageSync('bindSellerId') || 0;
    let tempSellerId = getTempSellerId(this)
    const scene = Taro.getCurrentInstance().router.params.scene as string | undefined;
    if (scene && (/^\d+_\d+_\d+$/.test(scene) || /^\d+_\d+_\d+_\d+$/.test(scene))) {
      const paramArr = scene.split('_'); // [ itemId, sellerId, bindSellerId, sid ] 长度不固定
      if (paramArr[3]) {
        tempSellerIdParams = tempSellerId = paramArr[3]
        setTempSellerId(tempSellerId)
      }
      id = paramArr[0]
    }
    this.setState({tempSellerId, memberAdvertisement: await getMemberAdvertisement({ position: 'xiangqing' })})
    if (platformSet.isSellerPermanentLock) {
      if (!bindSellerId) {
        bindSellerId = Taro.getCurrentInstance().router.params.bindSellerId || bindSellerId;
      }
    } else {
      bindSellerId = Taro.getCurrentInstance().router.params.bindSellerId || bindSellerId;
    }
    user.bindSellerId = bindSellerId
    Taro.setStorage({
      key: 'bindSellerId',
      data: user.bindSellerId,
    })
    if (this.state.itemId) {
      const detail = await this.getDetailData(this.state.itemId, this.state.bindSellerId);
      await this.initData(detail)
    }
    if (platform.subscription.show_place.indexOf("2") > -1) {
      this.setState({
        openMp: platform.subscription
      })
    }
    handlerRichImage()
    let isUser = true
    let isShowShareButton = false
    let identityIsSeller
    if (process.env.DISTINGUISH_IDENTITY) {
      identityIsSeller = await http.get(IDENTITY_IS_SELLER, {})
      isUser = !identityIsSeller.isSeller
    }
    if (process.env.SHOW_SHARE_POSTER) {
      isShowShareButton = identityIsSeller.isShowShareButton
    }
    if ((tempSellerIdParams || Taro.getCurrentInstance().router.params.tempSellerId) && isLogin && isUser && process.env.DISTINGUISH_IDENTITY) {
      const params = {
        category: 3,
        main_id: id,
        share_seller_id: tempSellerIdParams || tempSellerId
      }
      http.get(SHARE_USER_SHARE_INFO, params)
    }
    this.setState({isUser, isShowShareButton})
  }

  clearTimeOutGetInfoId
  count = 0

  async componentWillUnmount() {
    const {good} = this.state
    await this.setStateSync({good, isOpenedNotice: false, popInfo: false})
    clearInterval(this.clearTimeOutGetInfoId)
  }

  async componentDidHide() {
    clearInterval(this.clearTimeOutGetInfoId)
    this.setState({popInfo: false})
  }

  async initData(detail) {
    const isLogin = await user.checkLogin();
    let labels: any = {data: []}
    const {limitGoodsId, goodsDiscountCodeType, goodsDiscountCodeId} = this.state
    this.setState({popInfo: false, isLogin})
    this.getIsFavoriteStatus(detail.uuid)
    if (detail) {
      const {description, notice, expense_description, itinerary_details} = detail
      delete detail.notice
      delete detail.description
      delete detail.expense_description
      delete detail.itinerary_details
      let bindSellerId = Taro.getCurrentInstance().router.params.bindSellerId || ''
      let tempSellerId = Taro.getCurrentInstance().router.params.tempSellerId || ''
      const scene = Taro.getCurrentInstance().router.params.scene || ''
      if (scene && (/^\d+_\d+_\d+$/.test(scene) || /^\d+_\d+_\d+_\d+$/.test(scene))) {
        const paramArr = scene.split('_');
        if (paramArr[2]) {
          bindSellerId = paramArr[2]
        }
        if (paramArr[3]) {
          tempSellerId = paramArr[3]
        }
      }
      if ((bindSellerId || tempSellerId) && isLogin && process.env.DISTINGUISH_IDENTITY) {
        http.HPost(SCAN_BIND_SELLER, {temp_seller_id: tempSellerId, refer_seller_id: bindSellerId});
      }
      const info: any = await newHttp.catchGet(TOURIST_INFO, {
        refer_seller_id: bindSellerId,
        temp_seller_id: tempSellerId,
        is_volume_series: Taro.getCurrentInstance().router.params.is_volume_series || '',
        uuid: detail.uuid,
        limit_goods_id: limitGoodsId,
        goodsDiscountCodeType,
        goodsDiscountCodeId
      });
      let res: any = {data: false}
      let wxres: any = {data: false}
      let goodsId = ''
      if (info && info.goodsList && info.goodsList.length > 0) {
        const goodsIdArray: any = []
        for (let i=0; i<info.goodsList.length; i++) {
          goodsIdArray.push(info.goodsList[i].id)
        }
        goodsId = goodsIdArray.join(',')
      } else {
        goodsId = detail.id
      }
      if ((await user.checkLogin()) && process.env.IS_SHOW_LIVING_CODE) {
        res = await http.HGet(CONTENT_QR, {id: detail.uuid, goods_id: goodsId, goods_type: 3});
        wxres = await http.HGet(CONTENT_QRWX, {id: detail.uuid, goods_id: goodsId});
      }
      const siteId = Taro.getCurrentInstance().router.params.siteId;
      if (siteId && process.env.IS_SHOW_LIVING_CODE) {
        res = await http.HGet(CONTENT_QR, {id: detail.uuid, sid: siteId, goods_id: goodsId, goods_type: 3});
      }
      if (res.data) {
        this.setState({qrImg: res.data.code, qrImgDescribe: res.data.code_describe})
      }
      this.setState({wxQrImg: wxres.data})
      const goodStatus = status[info.status || 1]
      this.setState({goodStatus})
      if (!info) {
        setTimeout(function () {
          Taro.switchTab({
            url: '/pages/index/index'
          })
        }, 2000)
      }
      const isOver = []
      let overFlag = false
      if (info && info.goodsList && info.goodsList.length > 0) {
        labels = await http.carGet(GET_PRODUCT_LABELS, {category: 3, id: detail.id});
        const serviceLabels = JSON.stringify(info.goodsList[0].serviceLabels)
        const labelsFlag = info.goodsList.every(item => JSON.stringify(item.serviceLabels) === serviceLabels)
        info.goodsList.map(item => {
          if (labelsFlag) {
            item.serviceLabels = []
          }
          item.instructionsList = getGoodsInstructions(item, '', true, false)
          isOver.push(item.isGoodsDayInfo)
          const time = new Date(item.sell_begin).getTime()
          item['lastMin'] = !lastMinute(time)
        })
        overFlag = isOver.every(item => {
          return item === isOver[0] && item == 3
        })
      }
      let isOpenedNotice = false
      if (detail.is_open_purchase_information && this.count === 0 && detail.purchase_information) {
        ++this.count
        isOpenedNotice = true
      }
      const refundLabels = dealRefundSign(info.goodsList);
      if (process.env.TARO_ENV === 'tt') {
        detail.isSupportGroup = false
        const list = getShareSpuId(info.goodsList)
        if (list.length > 0) {
          this.spuId = list[0].bd_spu_id
        }
        detail.b_scanning = []
      }
      this.setState({
        labels: labels.data,
        good: detail,
        isOpenedNotice,
        info,
        overFlag,
        showLoading: false,
        refundLabels
      })
      if (isLogin && detail.is_pub && platform.info.application_open_bubble) {
        this.clearTimeOutGetInfoId = setInterval(async () => {
          const popInfo = await http.HPost(BUBBLE_GET_INFO, {})
          this.setState({popInfo: popInfo.data})
        }, 5000)
      }
      if (detail.share_data_flag) {
        this.setState({
          sloganList: detail.share_data_json.shareInfoArr ? detail.share_data_json.shareInfoArr.slogan_list : [],
          power: detail.share_data_flag,
          userPower: detail.share_data_json.power,
          shareSetting: detail.share_data_json.shareInfoArr ? detail.share_data_json.shareInfoArr.img_list : []
        })
      }
      if (!info.isSeller && detail.share_data_flag && detail.share_data_json.power && !detail.share_data_json.power.includes('2')) {
        this.setState({
          power: false,
        })
      }
      this.getInfo(info, detail, description, notice)
      this.setState({
        itinerary_details,
        expense_description
      });
    }
  }

  mealIndex = 0
  descIndex = 0
  noticeIndex = 0
  evaluationIndex = 0
  recommendIndex = 0
  topHeight = 0
  itineraryIndex = 0
  expenseIndex = 0

  async getInfo(info, detail, description, allNotice) {
    const recommendGood: any = []
    let evaluationList: any = []
    if (info) {
      const isLogin = await user.checkLogin()
      if (info.goodsList && info.goodsList.length > 0) {
        info.goodsList.map(item => {
          const time = new Date(item.sell_begin).getTime()
          item['lastMin'] = !lastMinute(time)
        })
        const result = await fetchNewGoodsList.getGoodsList({
          module_type: "2",
          page: 1,
          length: 10,
          data_type: 4,
          uuid: info.goodsList[0].uuid
        });
        for(let i = 0, len = result.length; i < len; i++) {
          const obj = {
            ...result[i],
            commission_price: result[i].commission || "",
            salesVolume: result[i].sales_volume,
          }
          recommendGood.push(obj);
        }
      }
      let tabs = [{title: '介绍', name: 'desp'}, {title: '须知', name: 'notice'}];
      if (process.env.P_ENV !== 'kd') {
        tabs = [{title: '产品特色', name: 'desp'},{title: '行程详情', name: 'itinerary_details'},{title: '费用说明', name: 'expense_description'}, {title: '购买须知', name: 'notice'}]
      }
      if (platform.info.application_open_comment && process.env.TARO_ENV !== 'tt') {
        evaluationList = await http.HPost(GOODS_EVALUATION_APP_LIST, {
          page: 1,
          length: 3,
          k: '',
          search_product_no: detail.no,
          search_main_type: 3,
          search_product_id: detail.id
        })
        if (evaluationList && evaluationList.data && evaluationList.data.length > 0 && isLogin) {
          tabs.push({title: '评价', name: 'evaluation'})
          this.setState({evaluationList: evaluationList.data, recordsTotal: evaluationList.recordsTotal})
        }
      }
      if (recommendGood && recommendGood.length > 0 && platform.info.application_open_comment) {
        tabs.push({title: '推荐', name: 'recommend'})
      }
      let destination = [];
      let departure = [];
      if (detail.destinationCityStr) {
        let destinationArr;
        if (detail.destinationCityStr.indexOf(',') > 0) {
          destinationArr = detail.destinationCityStr.split(',')
        } else {
          destinationArr = [detail.destinationCityStr]
        }
        if (destinationArr && destinationArr.length > 0) destination = destinationArr
      }
      if (detail.departureCityStr) {
        let departureArr;
        if (detail.departureCityStr.indexOf(',') > 0) {
          departureArr = detail.departureCityStr.split(',')
        } else {
          departureArr = [detail.departureCityStr]
        }
        if (departureArr && departureArr.length > 0) departure = departureArr
      }
      if (detail.meal_details) {
        tabs.unshift({title: '套餐', name: 'meal'})
      }
      for (let i = 0; i < tabs.length; i++) {
        if (tabs[i].name === 'meal') {
          this.mealIndex = i
        }
        if (tabs[i].name === 'desp') {
          this.descIndex = i
        }
        if (tabs[i].name === 'notice') {
          this.noticeIndex = i
        }
        if (tabs[i].name === 'evaluation') {
          this.evaluationIndex = i
        }
        if (tabs[i].name === 'recommend') {
          this.recommendIndex = i
        }
        if (tabs[i].name === 'itinerary_details') {
          this.itineraryIndex = i
        }
        if (tabs[i].name === 'expense_description') {
          this.expenseIndex = i
        }
      }
      this.topHeight = TARO_ENV === 'h5' ? 56 : 142
      this.setState({
        allNotice,
        description,
        recommendGood,
        tabs,
        departure,
        destination,
      });
    }
  }

  async onlyData(detail, platformSet) {
    const isKd = process.env.P_ENV === 'kd'
    const tempSellerId = getTempSellerId(this)
    this.setState({tempSellerId})
    let poster
    if (detail.images[0] && detail.images[0].url) {
      poster = await getSharePoster({
        uuid: detail.uuid,
        imgUrl: detail.images[0] && detail.images[0].url,
        price: detail.price || 0,
        market_price: detail.market_price || 0,
        isDetail: 'tourist-line'
      });
    }
    const siteInfo = await http.get(TOURIST_DETAIL_SITE, {uuid: detail.uuid || ''});
    const itemName = isKd ? (detail.sub_title || detail.name || '') : (detail.name || detail.sub_title || '')
    this.setState({
      itemId: detail.uuid,
      sitePhone: detail.siteServiceTelephone || '',
      siteServiceWx: detail.siteServiceWx || '',
      sharePoster: poster,
      itemName,
      siteInfo,
      platformSet,
      isHideNavigation: platformSet.isHideNavigation
    })
    const shareParams = await user.getSellerParams(tempSellerId)
    this.shareParams = shareParams
    if (process.env.TARO_ENV === 'h5') {
      const shareData = {
        category: 3,
        isProduct: true,
        title: itemName,
        uuid: detail.uuid,
        desc: detail.goods_lightspot || detail.slogan || '',
        link: window.location.origin + '/common/tourist-line/detail?itemId=' + detail.uuid + '&' + shareParams,
        imgUrl: process.env.P_ENV === 'kd' ? detail.img : (poster.url || detail.img)
      }
      await h5Wx.share(shareData)
    }
  }

  async getDetailData(id = '', bindSellerId = 0, isId = false) {
    let data: any = {uuid: id, referSellerId: bindSellerId}
    if (isId) {
      data = {id, referSellerId: bindSellerId}
    }
    if (TARO_ENV === 'h5') {
      data.longUrl = await getLongUrl()
    }
    if (id) {
      const detail = await newHttp.catchGet(TOURIST_DETAIL, data);
      if (detail.b_scanning) {
        detail.b_scanning = detail.b_scanning.split(',')
      }
      if (detail) {
        return detail
      } else {
        setTimeout(() => {
          Taro.switchTab({url: '/pages/index/index'})
        }, 1500)
        return false
      }
    } else {
      return false
    }
  }

  onShareAppMessage() {
    if (process.env.TARO_ENV !== 'tt') {
      http.post(UPDATE_USER_SHARE_DATE, {})
    }
    const {itemName, itemId, good, sharePoster, isUser} = this.state
    const category = 3
    if (!isUser && process.env.TARO_ENV !== 'tt') {
      http.get(SHARE_SHARE_INFO, {category, main_uuid: itemId})
    }
    http.get(ADD_SHARE_VOLUME, {category, uuid: itemId})
    return {
      path: '/common/tourist-line/detail?itemId=' + itemId + '&' + this.shareParams + `&sKey=${Taro.getStorageSync('sKey' || '')}`,
      title: itemName,
      imageUrl: process.env.P_ENV === 'kd' ? good.url : (sharePoster.url || good.url),
      extra: {
        spu_id: this.spuId
      }
    };
  }

  onShareTimeline() {
    if (process.env.TARO_ENV !== 'tt') {
      http.post(UPDATE_USER_SHARE_DATE, {})
    }
    const {itemName, itemId, good, sharePoster, isUser} = this.state
    const category = 3
    if (!isUser && process.env.TARO_ENV !== 'tt') {
      http.get(SHARE_SHARE_INFO, {category, main_uuid: itemId})
    }
    http.get(ADD_SHARE_VOLUME, {category, uuid: itemId})
    user.checkLogin().then(isLogin => {
      if (isLogin) {
        http.HPost(ROOKIEGUID_TASK_RECORD, {remark: "朋友圈"})
      }
    })
    return {
      title: itemName,
      imageUrl: process.env.P_ENV === 'kd' ? good.url : (sharePoster.url || good.url),
      query: 'itemId=' + itemId + '&' + this.shareParams + `&sKey=${Taro.getStorageSync('sKey' || '')}`,
      extra: {
        spu_id: this.spuId
      }
    }
  }

  spuId = ''

  async navigate(address: string) {
    if (platform.info.isHideNavigation == 1) {
      return
    }
    Taro.showLoading({title: '导航中...'})
    const ret = await location.getCoordinate(address)
    Taro.hideLoading()
    if (ret) {
      lxH5Wx.navigation(ret.lat, ret.lng, address)
    } else {
      Taro.showToast({title: '导航失败,请检查地址信息,请检测地址', icon: 'none'})
    }
  }

  tabsClick(value) {
    const tabs = this.state.tabs;
    const select = tabs[value];
    this.setState({currentIndex: value, currentFlag: true});
    const timer = setTimeout(() => {
      clearTimeout(timer);
      this.setState({currentFlag: false});
    }, 1000);
    if (process.env.TARO_ENV === 'weapp' || process.env.TARO_ENV === 'tt') {
      const query = Taro.createSelectorQuery();
      query.selectViewport().scrollOffset();
      switch (select.name) {
        case 'meal':
          query.select('#meal').boundingClientRect();
          break;
        case 'recommend':
          query.select('#recommend').boundingClientRect();
          break;
        case 'notice':
          query.select('#notice').boundingClientRect();
          break;
        case 'desp':
          query.select('#description').boundingClientRect();
          break;
        case 'evaluation':
          query.select('#evaluation').boundingClientRect();
          break;
        case 'expense_description':
          query.select('#expense_description').boundingClientRect();
          break;
        case 'itinerary_details':
          query.select('#itinerary_details').boundingClientRect();
          break;
        default:
          break;
      }
      query.exec(res => {
        Taro.pageScrollTo({
          duration: 300,
          scrollTop: res[0].scrollTop + res[1].top - (process.env.TARO_ENV === 'tt' ? 50 : 141)
        })
      })
    } else {
      const a = document.getElementsByClassName('ScrollTo')
      Taro.pageScrollTo({
        duration: 300,
        scrollTop: a[value].offsetTop - 54
      })
    }
  }

  onPageScroll() {
    const {recommendGood, evaluationList, good, currentIndex, currentFlag} = this.state;
    const {mealIndex, descIndex, noticeIndex, evaluationIndex, recommendIndex, topHeight, itineraryIndex, expenseIndex} = this;
    const query = Taro.createSelectorQuery();
    if (good.meal_details) {
      query.select('#meal').boundingClientRect();
    }
    if (process.env.P_ENV === 'kd') {
      query.select('#description').boundingClientRect();
      query.select('#notice').boundingClientRect();
    } else {
      query.select('#description').boundingClientRect();
      query.select('#itinerary_details').boundingClientRect();
      query.select('#expense_description').boundingClientRect();
      query.select('#notice').boundingClientRect();
    }
    evaluationList && evaluationList.length > 0 && query.select('#evaluation').boundingClientRect();
    recommendGood && recommendGood.length > 0 && query.select('#recommend').boundingClientRect();
    let index = 0;
    query.exec(res => {
      if (good.meal_details && res[mealIndex] && res[mealIndex].top < topHeight) { // 套餐
        index = mealIndex
      }
      if (process.env.P_ENV === 'kd') {
        if (res[descIndex] && res[descIndex].top < topHeight) { // 图文介绍/产品特色
          index = descIndex
        }
        if (res[noticeIndex] && res[noticeIndex].top < topHeight) { // 购买须知
          index = noticeIndex
        }
      } else {
        if (res[descIndex] && res[descIndex].top < topHeight) { // 图文介绍/产品特色
          index = descIndex
        }
        if (res[itineraryIndex] && res[itineraryIndex].top < topHeight) { // 行程详情
          index = itineraryIndex
        }
        if (res[expenseIndex] && res[expenseIndex].top < topHeight) { // 费用详情
          index = expenseIndex
        }
        if (res[noticeIndex] && res[noticeIndex].top < topHeight) { // 购买须知
          index = noticeIndex
        }
      }
      if (evaluationList && evaluationList.length > 0 && res[evaluationIndex] && res[evaluationIndex].top < topHeight) { // 评价
        index = evaluationIndex
      }
      if (recommendGood && recommendGood.length > 0 && res[recommendIndex] && res[recommendIndex].top < topHeight) { // 猜你喜欢
        index = recommendIndex
      }
      if (index !== currentIndex && currentFlag) {
        this.setState({tabIndex: currentIndex});
      } else {
        this.setState({tabIndex: index});
      }
    })
  }

  posterRef = React.createRef<any>();

  async onGotoBuy() {
    this.checkJump() && this.setState({isOpened: true})
  }

  async getPoste() {
    try {
      Taro.showLoading({title: '加载中...'})
      const {isLogin, pkeys} = this.state
      if (!isLogin && !pkeys) {
        const timer = setTimeout(() => {
          clearTimeout(timer)
          user.jumpLogin()
          Taro.hideLoading()
        }, 500);
        return
      }
      let userIdentity = false
      if (isLogin) {
        userIdentity = await http.get(IDENTITY, {})
        if (userIdentity && userIdentity.sellerStatus && userIdentity.sellerStatus === 3) {
          return Taro.navigateTo({url: '/common/distributor/invite/group'})
        }
      }
      this.posterRef.current && this.posterRef.current.show();
      if (userIdentity && userIdentity.isSeller) {
        await http.get(SHARE_SHARE_INFO, {category: 3, main_uuid: this.state.good.uuid})
      }
      Taro.hideLoading()
    } catch (e) {
      Taro.hideLoading()
    }
  }

  async onGetPoster() {
    //先判断用户是否存在
    const isSeller = !this.state.isUser;
    const {good, tempSellerId, pkeys, itemId} = this.state
    const sKey = Taro.getStorageSync('sKey')
    if (isSeller || pkeys || process.env.P_ENV !== 'kd' || sKey === '5f9785ef-b81b-46c2-90e0-598e91d6c4b9' || sKey === '66e7da6efc014cd2be9ccd1b34530562' || sKey === '3b16d77f556f494db82a3c20d7178ad5' || sKey === '55ad98a1596040688e170e70fe862868') {
      Taro.showLoading({title: '获取海报中...'});
      const poster = await getPoster('tourist', good.uuid || '', '', tempSellerId)
      Taro.hideLoading();
      if (poster) {
        if (isSeller) {
          await http.get(SHARE_SHARE_INFO, {category: 3, main_uuid: good.uuid})
        }
        http.get(ADD_SHARE_VOLUME, {category: 3, uuid: itemId})
        Taro.navigateTo({url: '/distributor/poster/poster?url=' + poster.url})
      } else {
        Taro.showToast({title: '获取海报失败！', icon: 'none'})
      }
    } else {
      Taro.navigateTo({url: '/common/distributor/invite/join'})
    }
  }

  async navigateOut(latitude, longitude) {
    lxH5Wx.navigation(latitude, longitude)
  }

  makePhone(value) {
    try {
      const isH5 = TARO_ENV === 'h5'
      if (isH5 && isPc()) {
        Taro.showModal({
          title: '商家电话',
          content: value,
        })
        return false
      }
      Taro.makePhoneCall({
        phoneNumber: value
      })
    } catch (e) {
      Taro.showToast({title: '拨打电话失败', icon: 'none'})
    }
  }

  async getMSG(index, e) {
    e.stopPropagation()
    const isLogin = await user.checkLogin();
    if (!isLogin) {
      user.jumpLogin()
      return
    }
    const {info, platformSet} = this.state
    const that = this
    const uuid = info.goodsList[index].uuid
    try {
      const tmplIds = platformSet.saleMessageTemplateId || []
      const acceptAry = []
      Taro.requestSubscribeMessage({
        tmplIds,
        success(res) {
          //[tmplIds]是动态的键，即模板id，值包括'accept'、'reject'、'ban'、'filter'。'accept'表示用户同意订阅该条id对应的模板消息，'reject'表示用户拒绝订阅该条id对应的模板消息，'ban'表示已被后台封禁，'filter'表示该模板因为模板标题同名被后台过滤。例如 { errMsg: "requestSubscribeMessage:ok", zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE: "accept"} 表示用户同意订阅zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE这条消息
          tmplIds.map((item, i) => {
            if (res[item] == 'accept') {
              acceptAry.push(item)
            }
          })
          if (acceptAry.length > 0) {
            http.post(USER_SALE_SUB, {goodsUUID: uuid, templateIds: acceptAry.join(",")})
            info.goodsList[index]['is_subscribe'] = 1
            that.setState({info})
          }

        },
        fail(error) {
          Taro.showModal({
            title: '提示',
            content: '为了提供更好的服务，建议您开启订阅消息',
            success: (res) => {
              if (res.confirm) {
                Taro.openSetting()
              }
            }
          })
        }
      })
    } catch (e) {
      Taro.showModal({
        title: '提示',
        content: '为了提供更好的服务，建议您开启订阅消息',
        success: (res) => {
          if (res.confirm) {
            Taro.openSetting()
          }
        }
      })
    }

  }

  async removeMSG(index, e) {
    e.stopPropagation()
    const {info} = this.state
    const that = this
    const uuid = info.goodsList[index].uuid
    const ret = await http.postCar(OFF_USER_SALE_SUB, {goodsUUID: uuid})
    if (ret == '取消成功') {
      info.goodsList[index]['is_subscribe'] = 0
      that.setState({info})
    } else {
      Taro.showToast({title: '取消失败', icon: 'none'})
    }
  }

  djs(that, begin, index) {
    if (begin) {
      const {info} = that.state
      let timer;
      const start = new Date(begin).getTime()
      let now = new Date().getTime()
      if (start - now > 1000) {
        timer = setInterval(function () {
          if ((start - now) > 1000) {
            now = now + 1000
          } else {
            clearInterval(timer)
            info.goodsList[index].isGoodsDayInfo = 1
            that.setState({info})
          }
        }, 1000)
      }
      return true
    } else {
      return false
    }
  }

  async onOpenModel() {
    if (!(await user.checkLogin())) {
      return user.jumpLogin()
    }
    this.setState({modalShow: true})
  }

  async handleCancel() {
    this.setState({modalShow: false})
  }

  handleClose() {
    this.setState({modalShow: false})
  }

  async onWXOpenModel() {
    this.setState({wxModalShow: true})
  }

  async wxhandleCancel() {
    this.setState({wxModalShow: false})
  }

  setStateSync(state) {
    return new Promise(resolve => {
      this.setState(state, resolve);
    });
  }

  getGoodsList(goodsList) {
    return goodsList.filter(item => !!item.isGoodsDayInfo && item.isGoodsDayInfo == 1 && !!item.is_pub && (process.env.TARO_ENV === 'tt' ? !!item.isInStoreHouse : true))
  }

  getParams() {
    return `force_platform_seller=${this.state.force_platform_seller}&`
  }

  checkJump() {
    if (this.state.pkeys) {
      Taro.showToast({title: 'pc端此功能只做模拟，具体请前往移动端体验！', duration: 3500, icon: 'none'})
      return false
    }
    return true
  }

  async getIsFavoriteStatus(uuid) {
    const data = await newHttp.catchGet('/msvc-shop/v1/goods/hotel/isFavorite', {uuid: uuid, branch: 3})
    if(data) {
      this.setState({
        is_favorite: data.is_favorite
      })
    }
  }
  async collection(type) {
    const data = await handlerCollection(type, 3, this.state.good.id)
    if (data != false) {
      this.setState({
        is_favorite: type === 0 ? 1 : 0
      })
      await Taro.showToast({
        mask: true,
        icon: 'none',
        title: `${type === 0 ? '添加收藏成功！' : '取消收藏成功！'}`,
        image: TARO_ENV === 'h5' ? 'https://resource.ivcheng.com/upload/2022/08/19/1455aeb277d349efbe926662366b126b.png' : ''
      })
    }
  }

  handlerPreviewImage(urls, current){
    Taro.previewImage({
      urls,
      current
    })
  }

  renderRefundSignOfRight = (item) => {
    const dataColor = Taro.getStorageSync('colorData');
    let domRefundSign = null;
    const refund_signArr = item.refund_sign ? item.refund_sign.split(",") : "";

    if(refund_signArr.length > 0) {
      domRefundSign = refund_signArr.map((sign, index) => (
        !!sign &&
        <Text className='label'
          style={`border: 1Px solid ${dataColor.titleColor};color: ${dataColor.titleColor}`}
          key={index}
        >{sign}</Text>
      ))
    }

    return domRefundSign;
  }

  makeOrderNow(item) {
    const { isLogin, bdInfo, good, tempSellerId, fromOrderNum, limitGoodsId, goodsDiscountCodeType, goodsDiscountCodeId } = this.state;
    if (this.checkJump()) {
      if (isLogin) {
        if (process.env.TARO_ENV === 'tt') {
          if (bdInfo && bdInfo.type === 1) {
            return this.setState({isOpened: true})
          }
        }
        if (good.isSupportGroup) {
          Taro.navigateTo({
            url: `/main/order/combination?${this.getParams()}itemId=` + item.uuid + '&type=' + 'good' + '&uuid=' + good.uuid + '&category=' + good.category + (tempSellerId ? '&tempSellerId=' + tempSellerId : '') + (fromOrderNum ? `&fromOrderNum=${fromOrderNum}` : '')
          })
        } else {
          Taro.navigateTo({
            url: `/main/order/confirm?${this.getParams()}itemId=` + item.id + (tempSellerId ? '&tempSellerId=' + tempSellerId : '') + (fromOrderNum ? `&fromOrderNum=${fromOrderNum}` : '') + `&limitGoodsId=${limitGoodsId}&goodsDiscountCodeType=${goodsDiscountCodeType}&goodsDiscountCodeId=${goodsDiscountCodeId}`
          })
        }
      } else {
        user.jumpLogin()
      }
    }
  }

  render() {
    const dataColor = Taro.getStorageSync('colorData');
    const {
      bdInfo,
      is_favorite,
      memberAdvertisement,
      itinerary_details,
      expense_description,
      isShowShareButton,
      isUser,
      isOpenedNotice,
      minHeight,
      pkeys,
      force_platform_seller,
      overFlag,
      limitGoodsId,
      goodsDiscountCodeType,
      goodsDiscountCodeId,
      labels,
      popInfo,
      power,
      evaluationList,
      recordsTotal,
      sloganList,
      userPower,
      shareSetting,
      fromOrderNum,
      tempSellerId,
      good,
      isOpened,
      isLogin,
      siteInfo,
      tabIndex,
      tabs,
      recommendGood,
      info,
      sitePhone,
      allNotice,
      description,
      siteServiceWx,
      floatLayout,
      notice,
      destination,
      departure,
      showLoading,
      isHideNavigation,
      height,
      platformSet,
      openMp,
      modalShow,
      qrImg,
      wxModalShow,
      searchBarTop,
      wxQrImg,
      goodStatus,
      qrImgDescribe,
      refundLabels
    } = this.state;
    return (
      <View className='tourist-detail-root prodRoot' id='root'>
        {TARO_ENV !== 'tt' && TARO_ENV !== 'h5' && !showLoading && <View className='head-bg' style={`height: ${searchBarTop}Px;`}>
          <Headercar color='black' isLogin={isLogin} showShare={Boolean(true)} title={this.navigationBarTitle}
            tabColor='#000'
            showMenu={false} backgroundColor='#fff' bcolor='transparent'
          />
          <View className='search-bar'>
          </View>
        </View>}
        <GzhAuth />
        {process.env.TARO_ENV === "weapp" && good.live_room_id && <LiveBar roomId={good.live_room_id} />}
        <Skeleton loading={showLoading}
          title
          titleWidth='100%' rowHeight='275px'
        >
          <View className='swiper-box-wrapper'>
            {good && <View className='swiper-box'>
              <DetailHeader pkeys={pkeys} height={height} videoId={good.qq_video_id || ''} mp3={good.mp3 || ''}
                imagesList={good.images.map(item => item.url) || []}
              />
              {(process.env.P_ENV === 'vc' || process.env.P_ENV === 'kunxin') && is_favorite == 0 && <View className={`at-icon at-icon-star iconClass ${TARO_ENV === 'h5' ? '' : 'iconClass-weapp'}`} onClick={() => this.collection(0)}></View>}
              {(process.env.P_ENV === 'vc' || process.env.P_ENV === 'kunxin') && is_favorite == 1 && <View className={`at-icon at-icon-star-2 iconClass iconClass-add ${TARO_ENV === 'h5' ? '' : 'iconClass-weapp'}`} onClick={() => this.collection(1)}>
              </View>}
            </View>}
          </View>
        </Skeleton>
        <View className='limit-header-raduis'>
          {info.couponLabel && info.couponLabel.length > 0 &&
          <CouponBox list={info.couponLabel} isLogin={isLogin} category={good.category} goodsId={good.id} />}
          <ProductName goodsList={info.goodsList || []} shareVolume={good.share_volume}
            goodStatus={goodStatus}
            time={goodStatus == 0 && info.sell_begin_timestamp ? info.sell_begin_timestamp : ''}
            goodsLightspot={good.goods_lightspot} subTitle={good.sub_title} category={good.category}
            name={good.name} loading={showLoading} labels={labels || []}
            no={good.no || ''}
            refundLabels={refundLabels}
          />
          <Skeleton loading={showLoading} row={4} rowHeight={80}>
            <Block>
              {(process.env.P_ENV === 'vc' || process.env.P_ENV === 'kunxin') && !!platformSet && !!platformSet.applicationOpenVip && memberAdvertisement &&
              <View style='margin-top: 10px;'>
                <AdvertisementMember url={memberAdvertisement} />
              </View>}
            </Block>
          </Skeleton>
          <Skeleton loading={showLoading} row={4} rowHeight={80}>
            <Block>
              {(destination.length > 0 || departure.length > 0) && <View className='from-to-box'>
                <View className='item share-num destination'>
                  <View className='title'>目的地：</View>
                  <View className='city'>{destination.length > 0 && destination.map((item, index) => <View
                    key={index}
                    className='city-name'
                  >{item}</View>)}</View>
                </View>
                <View className='item share-num departure' style='margin-top: 10px;'>
                  <View className='title'>出发地：</View>
                  <View className='city'>{departure.length > 0 && departure.map((item, index) => <View key={index}
                    className='city-name'
                  >{item}</View>)}</View>
                </View>
              </View>}
              {good.latitude && good.longitude ?
                <View style='justify-content: space-between' className={`location ${(process.env.P_ENV === 'kunxin') ? 'kunxin-icon-location' : ''}`} style='margin-top: 10px;'
                  onClick={this.navigateOut.bind(this, good.latitude, good.longitude)}
                >
                  <View className='info'><Text selectable>{good.location}{good.address}</Text></View>
                  {isHideNavigation != 1 && process.env.P_ENV !== 'kunxin' &&
                  <Image className='img' src={RESOURCE_URL + "/upload/images/20210825/1629891614709_668.png"}
                    mode='aspectFill'
                  />}
                  {isHideNavigation != 1 && process.env.P_ENV === 'kunxin' &&
                  <Image className='img' src='https://resource.ivcheng.com/upload/2022/11/04/d1b0aefaf44d4f65bb6fd4f7bf952fc3.png'
                    mode='aspectFill'
                  />}
                </View>
                :
                <Block>
                  {good.address &&
                  <View style='justify-content: space-between' className={`location ${(process.env.P_ENV === 'kunxin') ? 'kunxin-icon-location' : ''}`} style='margin-top: 10px;'
                    onClick={this.navigate.bind(this, good.location + good.address)}
                  >
                    <View className='info'><Text selectable>{good.location}{good.address}</Text></View>
                    {isHideNavigation != 1 && process.env.P_ENV !== 'kunxin' &&
                    <Image className='img' src={RESOURCE_URL + "/upload/images/20210825/1629891614709_668.png"}
                      mode='aspectFill'
                    />}
                    {isHideNavigation != 1 && process.env.P_ENV === 'kunxin' &&
                    <Image className='img' src='https://resource.ivcheng.com/upload/2022/11/04/d1b0aefaf44d4f65bb6fd4f7bf952fc3.png'
                      mode='aspectFill'
                    />}
                  </View>}
                </Block>
              }
              {good.link_phone &&
              <View onClick={this.makePhone.bind(this, good.link_phone)} className={`good-phone ${(process.env.P_ENV === 'kunxin') ? 'kunxin-icon-good-phone' : ''}`}><View
                className='title'
              >联系电话：</View><View style='display: flex;'>
                <View className='text'><Text selectable>{good.link_phone}</Text></View>
                {process.env.P_ENV === 'kunxin'&& <Image className='img' src='https://resource.ivcheng.com/upload/2022/11/04/f2e9e1d2d03a4bc4b7c132ab2c377107.png' mode='aspectFill'  />}</View>
              </View>}
            </Block>
          </Skeleton>
        </View>
        {!showLoading && process.env.TARO_ENV === 'tt' && info.douyin_business_license && <View className='good-info-box' style='background-color: #fff;padding: 0 5px;'>
          <View onClick={this.handlerPreviewImage.bind(this, [info.douyin_business_license], info.douyin_business_license)} className='good-info-item' style='justify-content: space-between'>
            <View>商家资质</View>
            <View><AtIcon value='chevron-right' size={16} color='#000' /></View>
          </View>
        </View>}
        <Skeleton loading={showLoading} row={2} rowHeight={200}>
          <View className='listPrice'>
            {info.goodsList && info.goodsList.length > 0 && info.goodsList.map((item, i) => <View
              className='listPrice-box'
              key={item.id}
            >
              <View className='left' onClick={async () => {
                if (item.notice) {
                  await Taro.showLoading({title: '加载中...'})
                  await this.setStateSync({notice: JSON.stringify(item.notice), floatLayout: true})
                  Taro.hideLoading()
                }
              }}
              >
                <View className='title'>{item.name}</View>
                {item.bookingEndShow && <View className='notice'>{item.bookingEndShow}</View>}
                {
                  (item.serviceLabels || item.refund_sign) &&
                  <View className='labels'>
                    {item.serviceLabels.map(i => <Text className='label'
                      style={`border: 1Px solid ${dataColor.titleColor};color: ${dataColor.titleColor}`}
                    >{i.name}</Text>)}
                    {
                      process.env.P_ENV === 'kd' && item.refund_sign &&
                      this.renderRefundSignOfRight(item)
                    }
                    </View>
                }
                <View className='instructions'>
                  {item.instructionsList.map((instructionsItem, instructionsIndex) => {
                    return <Block key={instructionsIndex}>
                      <Text onClick={async (e)=>{
                        if (instructionsItem.jump) {
                          e.stopPropagation()
                          Taro.navigateTo({url: instructionsItem.jumpLink})
                        } else if (instructionsItem.showAlert && item.notice) {
                          await this.setStateSync({notice: JSON.stringify(item.notice), floatLayout: true})
                        }
                      }} decode
                      >{instructionsItem.key}{instructionsItem.value}</Text>
                      {(instructionsIndex !== item.instructionsList.length - 1) && <Text decode>&nbsp;|&nbsp;</Text>}
                    </Block>
                  })}
                </View>
              </View>
              <View className='right'>
                {item.isGoodsDayInfo && item.isGoodsDayInfo == 1 ?
                  <Block>
                    <View className='mark-price'>
                      {(item.vip_price != null && item.vip_price >= 0) &&
                      <Text className='members-enjoy-wrapper'
                        style={`border: 1px solid ${dataColor.discountBgColor};top: inherit !important;margin-right: 0 !important`}
                      ><Text
                        className={`members-enjoy-symbol ${TARO_ENV + 'members-enjoy-symbol'}`}
                      >￥</Text><Text
                        className={`members-enjoy-price font-family-price ${TARO_ENV + 'members-enjoy-price'}`}
                      >{item.vip_price}</Text><Text
                        className='members-enjoy'
                      >会员享</Text></Text>}
                      {!!item.discount && <Text className='discount'
                        style={`background-color: ${dataColor.priceColor}`}
                      >{item.discount}折</Text>}
                      <Text className='symbol font-family-price' style={`color: ${dataColor.priceColor};margin-left: 6px;`}>¥</Text><Text
                        className='scribing font-family-price'
                        style={`color: ${dataColor.priceColor}`}
                      >{item.price}</Text>
                      <Text className='market font-family-price'
                        style={`color: ${dataColor.originalPriceColor}`}
                      >¥{item.market_price}</Text>
                    </View>
                    {process.env.DISTINGUISH_IDENTITY && !!info.isSeller &&
                    <View className='brokerage' style={`color: ${dataColor.priceColor}`}>{!!item.first_brokerage &&
                    <Text decode>&nbsp;上级佣金:<Text style={`color: ${dataColor.priceColor}`}
                      className='number font-family-price'
                    >￥{item.first_brokerage}</Text></Text>}{!!item.brokerage &&
                    <Text className='brokerage-text' style={`color: ${dataColor.priceColor}`}>佣金:<Text
                      className='number font-family-price' style={`color: ${dataColor.priceColor}`}
                    >￥{item.brokerage}</Text></Text>}</View>}
                    {(process.env.TARO_ENV === 'tt' ? !!item.isInStoreHouse : true) &&
                    <View className='place' onClick={this.makeOrderNow.bind(this, item)}>立即下单</View>}
                  </Block>
                  :
                  <Block>
                    {item.isGoodsDayInfo == 2 &&
                    <Block>
                      <View className='mark-price'>
                        {(item.vip_price != null && item.vip_price >= 0) &&
                        <Text className='members-enjoy-wrapper'
                          style={`border: 1px solid ${dataColor.discountBgColor};top: inherit !important;margin-right: 0 !important`}
                        ><Text
                          className={`members-enjoy-symbol ${TARO_ENV + 'members-enjoy-symbol'}`}
                        >￥</Text><Text
                          className={`members-enjoy-price font-family-price ${TARO_ENV + 'members-enjoy-price'}`}
                        >{item.vip_price}</Text><Text
                          className='members-enjoy'
                        >会员享</Text></Text>}
                        {!!item.discount && <Text className='discount'
                          style={`background-color: ${dataColor.priceColor}`}
                        >{item.discount}折</Text>}
                        <Text className='symbol font-family-price' style={`color: ${dataColor.priceColor};margin-left: 6px;`}>¥</Text>
                        <Text className='scribing font-family-price'
                          style={`color: ${dataColor.priceColor}`}
                        >{item.price}</Text>
                        <Text className='market font-family-price'
                          style={`color: ${dataColor.originalPriceColor}`}
                        >¥{item.market_price}</Text>
                      </View>
                      {item.sell_begin && this.djs(this, item.sell_begin, i) && <View
                        className='mark-time'
                      >{`${item.sell_begin.substr(5, 2)}月${item.sell_begin.substr(8, 2)}日`}<Text>{item.sell_begin.substr(11, 5)}</Text>准时开售</View>}
                      {process.env.DISTINGUISH_IDENTITY && !!info.isSeller && <View className='brokerage'>{!!item.first_brokerage &&
                      <Text decode style={`color: ${dataColor.priceColor}`}>&nbsp;上级佣金:<Text
                        className='number font-family-price' style={`color: ${dataColor.priceColor}`}
                      >￥{item.first_brokerage}</Text></Text>}{!!item.brokerage &&
                      <Text className='brokerage-text' style={`color: ${dataColor.priceColor}`}>佣金:<Text
                        className='number font-family-price' style={`color: ${dataColor.priceColor}`}
                      >￥{item.brokerage}</Text></Text>}</View>}
                      {platformSet && platformSet.openSaleMessageSubscribe && item.lastMin ?
                        <Block>
                          {item.is_subscribe ?
                            <View className='place-disabled' onClick={this.removeMSG.bind(this, i)}
                              style='background-image: linear-gradient(to right, #e7874f, #ea7448);color:#fff'
                            >取消提醒</View>
                            : process.env.TARO_ENV === 'h5' ? <View className='place-disabled'
                                style='background-image: linear-gradient(to right, #e7874f, #ea7448);color:#fff'
                            >即将开售</View> :
                              <View className='place-disabled' onClick={this.getMSG.bind(this, i)}
                                style='background-image: linear-gradient(to right, #e7874f, #ea7448);color:#fff'
                              >开售提醒</View>
                          }
                        </Block>
                        :
                        <View className='place-disabled'
                          style='background-color:#f3b294;color:#fff'
                        >未开始</View>
                      }

                    </Block>
                    }
                    {item.isGoodsDayInfo == 0 &&
                    <Block>
                      <View className='mark-price'>
                        {(item.vip_price != null && item.vip_price >= 0) &&
                        <Text className='members-enjoy-wrapper'
                          style={`border: 1px solid ${dataColor.discountBgColor};top: inherit !important;margin-right: 0 !important`}
                        ><Text
                          className={`members-enjoy-symbol ${TARO_ENV + 'members-enjoy-symbol'}`}
                        >￥</Text><Text
                          className={`members-enjoy-price font-family-price ${TARO_ENV + 'members-enjoy-price'}`}
                        >{item.vip_price}</Text><Text
                          className='members-enjoy'
                        >会员享</Text></Text>}
                        {!!item.discount && <Text className='discount'
                          style={`background-color: ${dataColor.priceColor}`}
                        >{item.discount}折</Text>}
                        <Text className='symbol font-family-price'
                          style={`color: ${dataColor.priceColor};margin-left: 6px;`}
                        >¥</Text><Text
                          className='scribing font-family-price'
                          style={`color: ${dataColor.priceColor}`}
                        >{item.price}</Text>
                        <Text className='market font-family-price'
                          style={`color: ${dataColor.originalPriceColor}`}
                        >¥{item.market_price}</Text>
                      </View>
                      {process.env.DISTINGUISH_IDENTITY && !!info.isSeller && <View className='brokerage'>{!!item.first_brokerage &&
                      <Text decode style={`color: ${dataColor.priceColor}`}>&nbsp;上级佣金:<Text
                        className='number font-family-price' style={`color: ${dataColor.priceColor}`}
                      >￥{item.first_brokerage}</Text></Text>}{!!item.brokerage &&
                      <Text className='brokerage-text' style={`color: ${dataColor.priceColor}`}>佣金:<Text
                        className='number font-family-price' style={`color: ${dataColor.priceColor}`}
                      >￥{item.brokerage}</Text></Text>}</View>}
                      <View className='place-disabled'>已售罄</View>
                    </Block>
                    }
                    {item.isGoodsDayInfo == 3 &&
                    <Block>
                      {(!!item.price && item.isGoodsDayInfo != 0) &&
                      <View className='mark-price'>
                        {(item.vip_price != null && item.vip_price >= 0) &&
                        <Text className='members-enjoy-wrapper'
                          style={`border: 1px solid ${dataColor.discountBgColor};top: inherit !important;margin-right: 0 !important`}
                        ><Text
                          className={`members-enjoy-symbol ${TARO_ENV + 'members-enjoy-symbol'}`}
                        >￥</Text><Text
                          className={`members-enjoy-price font-family-price ${TARO_ENV + 'members-enjoy-price'}`}
                        >{item.vip_price}</Text><Text
                          className='members-enjoy'
                        >会员享</Text></Text>}
                        {!!item.discount && <Text className='discount'
                          style={`background-color: ${dataColor.priceColor}`}
                        >{item.discount}折</Text>}
                        <Text className='symbol font-family-price'
                          style={`color: ${dataColor.priceColor};margin-left: 6px;`}
                        >¥</Text><Text
                          className='scribing font-family-price'
                          style={`color: ${dataColor.priceColor}`}
                        >{item.price}</Text>
                        <Text className='market font-family-price'
                          style={`color: ${dataColor.originalPriceColor}`}
                        >¥{item.market_price}</Text>
                      </View>}
                      {process.env.DISTINGUISH_IDENTITY && (!!info.isSeller && item.isGoodsDayInfo != 0) &&
                      <View className='brokerage'>{!!item.first_brokerage &&
                      <Text decode style={`color: ${dataColor.priceColor}`}>&nbsp;上级佣金:<Text
                        className='number font-family-price' style={`color: ${dataColor.priceColor}`}
                      >￥{item.first_brokerage}</Text></Text>}{!!item.brokerage &&
                      <Text className='brokerage-text' style={`color: ${dataColor.priceColor}`}>佣金:<Text
                        className='number font-family-price' style={`color: ${dataColor.priceColor}`}
                      >￥{item.brokerage}</Text></Text>}</View>}
                      <View className='place-disabled'>已停售</View>
                    </Block>
                    }
                  </Block>
                }
              </View>
            </View>)}
          </View>
        </Skeleton>
        {/*{process.env.TARO_ENV === 'tt' && <JoinTtGroup platformSet={platformSet} />}*/}
        <Skeleton loading={showLoading}
          title
          titleWidth='100%' rowHeight='375px'
        >
          <Block>
            <View className='joinWx-enterStore'>
              {good.sid && process.env.TARO_ENV !== 'tt' && <JoinWx sid={good.sid} phone={sitePhone} />}
              {Object.keys(siteInfo).length != 0  && process.env.TARO_ENV !== 'tt' && <View className='joinWx-enterStore-line' />}
              {Object.keys(siteInfo).length != 0 && <EnterStore siteInfo={siteInfo} stars={siteInfo.star} />}
            </View>
            <View className='tabs' style={`${TARO_ENV !== 'h5' && `top: ${searchBarTop}Px;`}`}><View
              className='fixedTabs'
            ><AtTabs current={tabIndex}
              tabList={tabs}
              onClick={this.tabsClick.bind(this)}
            /></View></View>
            {process.env.P_ENV !== 'kd' && <Block>
              {good.meal_details && <View className='detail-content ScrollTo no-top'>
                <View className='rich-content' id='meal'>
                  <View className='content-header'>
                    <View className='line' style={`background-color: ${process.env.mainColor}`} />
                    <View className='title'>套餐包含</View>
                  </View>
                  {TARO_ENV === 'weapp' && <View className='content-info'>
                    <parser selectable html={good.meal_details || ''} />
                  </View>}
                  {TARO_ENV === 'tt' && <View className='content-info'>
                    <rich-text preview selectable nodes={getContent(good.meal_details)} />
                  </View>}
                  {TARO_ENV === 'h5' && <Text selectable className='content-info'>
                    {!!good.meal_details &&
                    <View id='html-description' dangerouslySetInnerHTML={{__html: good.meal_details}} />}
                  </Text>}
                </View>
              </View>}
              <View className='detail-content ScrollTo'>
                <View className='rich-content' id='description'>
                  <View className='content-header'><View className='line'
                    style={`background-color: ${process.env.mainColor}`}
                  /><View
                    className='title'
                  >产品特色</View></View>
                  {TARO_ENV === 'weapp' && <View className='content-info content-info-no-l-r'>
                    <parser selectable html={description || ''} />
                  </View>}
                  {TARO_ENV === 'tt' && <View className='content-info content-info-no-l-r'>
                    <rich-text preview selectable nodes={getContent(description)} />
                  </View>}
                  {TARO_ENV === 'h5' && <Text selectable className='content-info content-info-no-l-r'>
                    {!!description && <View id='html-description' dangerouslySetInnerHTML={{__html: description}} />}
                  </Text>}
                </View>
              </View>
              {(process.env.P_ENV === 'vc' || process.env.P_ENV === 'kunxin' || process.env.P_ENV === 'kontai') && <View className='detail-content ScrollTo'>
                <View className='rich-content' id='itinerary_details'>
                  <View className='content-header'><View className='line'
                    style={`background-color: ${process.env.mainColor}`}
                  /><View
                    className='title'
                  >行程详情</View></View>
                  {TARO_ENV === 'weapp' && <View className='content-info content-info-no-l-r'>
                    <parser selectable html={itinerary_details || ''} />
                  </View>}
                  {TARO_ENV === 'tt' && <View className='content-info content-info-no-l-r'>
                    <rich-text preview selectable nodes={getContent(itinerary_details)} />
                  </View>}
                  {TARO_ENV === 'h5' && <Text selectable className='content-info content-info-no-l-r'>
                    {!!itinerary_details && <View id='html-description' dangerouslySetInnerHTML={{__html: itinerary_details}} />}
                  </Text>}
                </View>
              </View>}
              {(process.env.P_ENV === 'vc' || process.env.P_ENV === 'kunxin' || process.env.P_ENV === 'kontai') && <View className='detail-content ScrollTo'>
                <View className='rich-content' id='expense_description'>
                  <View className='content-header'><View className='line'
                    style={`background-color: ${process.env.mainColor}`}
                  /><View
                    className='title'
                  >费用说明</View></View>
                  {TARO_ENV === 'weapp' && <View className='content-info content-info-no-l-r'>
                    <parser selectable html={expense_description || ''} />
                  </View>}
                  {TARO_ENV === 'tt' && <View className='content-info content-info-no-l-r'>
                    <rich-text preview selectable nodes={getContent(expense_description)} />
                  </View>}
                  {TARO_ENV === 'h5' && <Text selectable className='content-info content-info-no-l-r'>
                    {!!expense_description && <View id='html-description' dangerouslySetInnerHTML={{__html: expense_description}} />}
                  </Text>}
                </View>
              </View>}
              <View className='detail-content ScrollTo no-top'>
                <View className='rich-content' id='notice'>
                  <View className='content-header'><View className='line'
                    style={`background-color: ${process.env.mainColor}`}
                  /><View
                    className='title'
                  >购买须知</View></View>
                  {TARO_ENV === 'weapp' && <View className='content-info'>
                    <parser selectable html={allNotice || ''} />
                  </View>}
                  {TARO_ENV === 'tt' && <View className='content-info'>
                    <rich-text preview selectable nodes={getContent(allNotice)} />
                  </View>}
                  {TARO_ENV === 'h5' && <Text selectable className='content-info'>
                    {!!allNotice && <View id='html-description' dangerouslySetInnerHTML={{__html: allNotice}} />}
                  </Text>}
                </View>
              </View>
            </Block>}
            {process.env.P_ENV === 'kd' && <Block>
              {good.meal_details && <View className='detail-content ScrollTo no-top'>
                <View className='rich-content' id='meal'>
                  <View className='content-header'>
                    <View className='line' style={`background-color: ${process.env.mainColor}`} />
                    <View className='title'>套餐包含</View>
                  </View>
                  {TARO_ENV === 'weapp' && <View className='content-info'>
                    <parser selectable html={good.meal_details || ''} />
                  </View>}
                  {TARO_ENV === 'tt' && <View className='content-info'>
                    <rich-text preview selectable nodes={getContent(good.meal_details)} />
                  </View>}
                  {TARO_ENV === 'h5' && <Text selectable className='content-info'>
                    {!!good.meal_details &&
                    <View id='html-description' dangerouslySetInnerHTML={{__html: good.meal_details}} />}
                  </Text>}
                </View>
              </View>}
              <View className='detail-content ScrollTo no-top'>
                <View className='rich-content' id='description'>
                  <View className='content-header'><View className='line'
                    style={`background-color: ${process.env.mainColor}`}
                  /><View
                    className='title'
                  >产品特色</View></View>
                  {TARO_ENV === 'weapp' && <View className='content-info content-info-no-l-r'>
                    <parser selectable html={description || ''} />
                  </View>}
                  {TARO_ENV === 'tt' && <View className='content-info content-info-no-l-r'>
                    <rich-text preview selectable nodes={getContent(description)} />
                  </View>}
                  {TARO_ENV === 'h5' && <Text selectable className='content-info content-info-no-l-r'>
                    {!!description && <View id='html-description' dangerouslySetInnerHTML={{__html: description}} />}
                  </Text>}
                </View>
              </View>
              <View className='detail-content ScrollTo'>
                <View className='rich-content' id='notice'>
                  <View className='content-header'><View className='line'
                    style={`background-color: ${process.env.mainColor}`}
                  /><View
                    className='title'
                  >购买须知</View></View>
                  {TARO_ENV === 'weapp' && <View className='content-info'>
                    <parser selectable html={allNotice || ''} />
                  </View>}
                  {TARO_ENV === 'tt' && <View className='content-info'>
                    <rich-text preview selectable nodes={getContent(allNotice)} />
                  </View>}
                  {TARO_ENV === 'h5' && <Text selectable className='content-info'>
                    {!!allNotice && <View id='html-description' dangerouslySetInnerHTML={{__html: allNotice}} />}
                  </Text>}
                </View>
              </View>
            </Block>}
            {openMp && !pkeys && <View className='detail-content'><Subscription data={openMp} /></View>}
            {evaluationList.length > 0 && <View className='detail-content ScrollTo'>
              <View className='evaluation-goods-box' id='evaluation'>
                <View className='good'>
                  <Evaluation recordsTotal={recordsTotal} data={evaluationList} category={3} productId={good.id} product_no={good.no} />
                </View>
              </View>
            </View>}
            {((good.b_scanning && good.b_scanning.length > 0) || process.env.DETAIL_SHOW_NO) && <View className='good-info-box'>
              {good.b_scanning && good.b_scanning.length > 0 && <View onClick={this.handlerPreviewImage.bind(this, good.b_scanning, good.b_scanning[0])} className='good-info-item' style='justify-content: space-between'>
                <View>商家资质</View>
                <View><AtIcon value='chevron-right' size={16} color='#000' /></View>
              </View>}
              {process.env.DETAIL_SHOW_NO && <View className='good-info-item'>
                <View className='_no'>编号：{good.no}</View>
              </View>}
            </View>}
            {recommendGood.length > 0 && <View className='detail-content ScrollTo'>
              <View className='recommend-goods-box' id='recommend'>
                <View className='content-header'><View className='line'
                  style={`background-color: ${process.env.mainColor}`}
                /><View
                  className='title'
                >猜你喜欢</View></View>
                <View className='good'>
                  <Category itemsNoPaddingLR='true' pkeys={pkeys} isUser={isUser} data={recommendGood} />
                </View>
              </View>
            </View>}
          </Block>
        </Skeleton>
        <SupportBar />
        <View style={{height: "100px"}} />
        <OtherBar bdInfo={bdInfo} notTwoOrder={info.notTwoOrder} forcePlatformSeller={force_platform_seller} overFlag={overFlag}
          limitGoodsId={limitGoodsId} isShowShareButton={isShowShareButton}
          goodsDiscountCodeType={goodsDiscountCodeType} goodsDiscountCodeId={goodsDiscountCodeId}
          onOffCar={() => this.setState({isOpened: false})}
          isLogin={isLogin} tempSellerId={tempSellerId} fromOrderNum={fromOrderNum} goods={good}
          goodsImg={good.img} good={this.getGoodsList(info.goodsList || [])}
          isOpened={isOpened} onGotoBuy={this.onGotoBuy.bind(this)} showBuy={!Boolean(good.isSupportGroup)}
          platformSet={platformSet} commissionPrice={info.commission_price} showLoading={showLoading}
          weChat={() => {
                    Taro.navigateTo({url: `/distributor/contact/contact/`})
                  }} isSupportGroup={Boolean(good.isSupportGroup)} inSale={Boolean(info.is_sale)}
          showService={Boolean(good.is_show_customer_service)} onGetPoster={this.getPoste.bind(this)}
          onGotoHome={() => {
                    if (this.checkJump()) {
                      if (TARO_ENV === 'h5') {
                        let mpkey = ''
                        const uInfo = Taro.getStorageSync('user') || ''
                        if (uInfo && uInfo.mpkey && uInfo.mpkey !== 'undefined') {
                          mpkey = uInfo.mpkey
                        }
                        window.location.replace(window.location.origin + '/pages/index/index?mpkey=' + mpkey)
                      } else {
                        Taro.switchTab({url: '/pages/index/index'})
                      }
                    }
                  }} onContact={() => {
          if (!isLogin) {
            return user.jumpLogin()
          }
          Taro.navigateTo({url: `/distributor/contact/contact${sitePhone ? '?phone=' + sitePhone + (siteServiceWx ? '&weixin=' + siteServiceWx : '') : (siteServiceWx ? '?weixin=' + siteServiceWx : '')}`})
        }} onGotoCom={() => {
          if (this.checkJump()) {
            if (isLogin) {
              Taro.navigateTo({url: `/main/order/combination?${this.getParams()}uuid=` + good.uuid + '&type=date' + '&category=' + good.category + `&fromOrderNum=${fromOrderNum}`})
            } else {
              user.jumpLogin()
            }
          }
        }} onOpenModel={this.onOpenModel.bind(this)} modalShow={modalShow} handleCancel={this.handleCancel.bind(this)}
          qrImg={qrImg} onWXOpenModel={this.onWXOpenModel.bind(this)} wxModalShow={wxModalShow}
          wxhandleCancel={this.wxhandleCancel.bind(this)} wxQrImg={wxQrImg} qrImgDescribe={qrImgDescribe}
        />
        {floatLayout && <AtFloatLayout isOpened={floatLayout} title='购买须知' scrollY onClose={() => {
          this.setState({notice: '', floatLayout: false})
        }}
        >
          <View className='float-layout' id='xuzhi'>
            {TARO_ENV === "weapp" && <parser html={notice ? JSON.parse(notice) : ''} />}
            {TARO_ENV === "tt" && <rich-text preview selectable nodes={notice ? JSON.parse(notice) : ''} />}
            {TARO_ENV === "h5" && <View dangerouslySetInnerHTML={{__html: notice ? JSON.parse(notice) : ''}} />}
          </View>
        </AtFloatLayout>}
        {!showLoading && <MakePoster pkeys={pkeys} userPower={userPower} commissionPrice={info.commission_price} power={power}
          sloganList={sloganList}
          shareSetting={shareSetting} cref={this.posterRef}
          friendsArr={good.images} category={3}
          text={good.slogan || ''} posterType='tourist'
          uuid={good.uuid} itemId={good.uuid} showButton={false} onGetPoster={async () => {
          await this.onGetPoster()
        }}
        />}
        {!showLoading && popInfo &&
        <PopView commissionPrice={info.commission_price} isSeller={Boolean(info && info.isSeller)} popInfo={popInfo}
          offsetTop={searchBarTop * 2 + 50 + 'rpx'}
        />}
        {isOpenedNotice && <AtModal className='notice-model' isOpened={isOpenedNotice} onClose={() => {
          this.setState({isOpenedNotice: false})
        }}
        >
          <AtModalHeader>购买须知<AtIcon onClick={() => {
            this.setState({isOpenedNotice: false})
          }} className='close-cla' value='close' size='20' color='#888888'
          /></AtModalHeader>
          <View className='w-b-ba'>
            <ScrollView
              style={`min-height:${minHeight + 'px'};max-height:${minHeight + 'px'}`}
              className='scrollView'
              scrollY
            >
              {process.env.TARO_ENV === "weapp" && <parser selectable html={good.purchase_information || ''} />}
              {process.env.TARO_ENV === "tt" && <rich-text preview selectable nodes={good.purchase_information} />}
              {process.env.TARO_ENV === "h5" && !!good.purchase_information &&
              <View className='gmxz' dangerouslySetInnerHTML={{__html: good.purchase_information}} />}
            </ScrollView>
          </View>
          <AtModalAction><Button onClick={() => {
            this.setState({isOpenedNotice: false})
          }} className='readed'
          >已阅读并确定</Button></AtModalAction>
        </AtModal>}
        {!showLoading && process.env.TARO_ENV === 'tt' && <JoinTt />}
      </View>
    )
  }
}

export default DetailWeb as ComponentClass<PageOwnProps, PageState>;
